package com.huawei.appgallery.forum.message.widget;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.huawei.appgallery.forum.base.card.bean.User;
import com.huawei.appgallery.forum.cards.widget.UserInfoTextView;
import com.huawei.appgallery.forum.cards.widget.UserInfoTextView.e;
import o.azb;
import o.bqx;
import o.bsy;
import o.btl;
import o.bvj;
import o.bvj.b;
import o.bvj.d;
import o.cbb;
import o.dof;
import o.epv;
import o.equ;

public class CommentReferenceUserView extends RelativeLayout implements e {
    private String ʻ;
    private String ʼ = "";
    private int ʽ = 0;
    protected Context ˊ;
    private boolean ˊॱ;
    private UserInfoTextView ˋ;
    private TextView ˎ;
    private LinearLayout ˏ;
    private String ˏॱ;
    private btl ͺ;
    private ImageView ॱ;
    private int ॱॱ;
    private TextView ᐝ;

    private void ˊ(android.util.AttributeSet r5) {
        /* JADX: method processing error */
/*
Error: java.util.NoSuchElementException
	at java.util.HashMap$HashIterator.nextNode(HashMap.java:1444)
	at java.util.HashMap$KeyIterator.next(HashMap.java:1466)
	at jadx.core.dex.visitors.blocksmaker.BlockFinallyExtract.applyRemove(BlockFinallyExtract.java:535)
	at jadx.core.dex.visitors.blocksmaker.BlockFinallyExtract.extractFinally(BlockFinallyExtract.java:175)
	at jadx.core.dex.visitors.blocksmaker.BlockFinallyExtract.processExceptionHandler(BlockFinallyExtract.java:79)
	at jadx.core.dex.visitors.blocksmaker.BlockFinallyExtract.visit(BlockFinallyExtract.java:51)
	at jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:31)
	at jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:17)
	at jadx.core.ProcessClass.process(ProcessClass.java:37)
	at jadx.core.ProcessClass.processDependencies(ProcessClass.java:59)
	at jadx.core.ProcessClass.process(ProcessClass.java:42)
	at jadx.api.JadxDecompiler.processClass(JadxDecompiler.java:306)
	at jadx.api.JavaClass.decompile(JavaClass.java:62)
*/
        /*
        r4 = this;
        r0 = 0;
        if (r5 == 0) goto L_0x0025;
    L_0x0003:
        r1 = 0;
        r2 = r4.getContext();	 Catch:{ RuntimeException -> 0x0026, all -> 0x0034 }
        r3 = o.bvj.i.ॱﾞ;	 Catch:{ RuntimeException -> 0x0026, all -> 0x0034 }
        r1 = r2.obtainStyledAttributes(r5, r3);	 Catch:{ RuntimeException -> 0x0026, all -> 0x0034 }
        r2 = o.bvj.i.ॱꜞ;	 Catch:{ RuntimeException -> 0x0026, all -> 0x0034 }
        r3 = 0;	 Catch:{ RuntimeException -> 0x0026, all -> 0x0034 }
        r2 = r1.getInteger(r2, r3);	 Catch:{ RuntimeException -> 0x0026, all -> 0x0034 }
        r4.ॱॱ = r2;	 Catch:{ RuntimeException -> 0x0026, all -> 0x0034 }
        r2 = r4.ॱॱ;	 Catch:{ RuntimeException -> 0x0026, all -> 0x0034 }
        r3 = 32;	 Catch:{ RuntimeException -> 0x0026, all -> 0x0034 }
        if (r2 == r3) goto L_0x001e;	 Catch:{ RuntimeException -> 0x0026, all -> 0x0034 }
    L_0x001d:
        r0 = 1;	 Catch:{ RuntimeException -> 0x0026, all -> 0x0034 }
    L_0x001e:
        r4.ˊॱ = r0;	 Catch:{ RuntimeException -> 0x0026, all -> 0x0034 }
        if (r1 == 0) goto L_0x0025;
    L_0x0022:
        r1.recycle();
    L_0x0025:
        return;
    L_0x0026:
        r0 = move-exception;
        r2 = "CommentReferenceUserView";	 Catch:{ RuntimeException -> 0x0026, all -> 0x0034 }
        r3 = "init(AttributeSet attrs) ";	 Catch:{ RuntimeException -> 0x0026, all -> 0x0034 }
        o.bqx.ˊ(r2, r3, r0);	 Catch:{ RuntimeException -> 0x0026, all -> 0x0034 }
        if (r1 == 0) goto L_0x0025;
    L_0x0030:
        r1.recycle();
        goto L_0x0025;
    L_0x0034:
        r0 = move-exception;
        if (r1 == 0) goto L_0x003a;
    L_0x0037:
        r1.recycle();
    L_0x003a:
        throw r0;
        */
        throw new UnsupportedOperationException("Method not decompiled: com.huawei.appgallery.forum.message.widget.CommentReferenceUserView.ˊ(android.util.AttributeSet):void");
    }

    public void setUserContentClickLisenter(btl o_btl) {
        this.ͺ = o_btl;
    }

    public CommentReferenceUserView(Context context) {
        super(context);
        ˊ(null);
        ॱ(context);
        ˋ();
    }

    public CommentReferenceUserView(Context context, AttributeSet attributeSet) {
        super(context, attributeSet);
        ˊ(attributeSet);
        ॱ(context);
        ˋ();
    }

    public CommentReferenceUserView(Context context, AttributeSet attributeSet, int i) {
        super(context, attributeSet, i);
        ˊ(attributeSet);
        ॱ(context);
        ˋ();
    }

    private void ॱ(Context context) {
        this.ˊ = context;
        View inflate = LayoutInflater.from(context).inflate(bvj.e.ˏ, this);
        this.ॱ = (ImageView) findViewById(b.ॱॱ);
        this.ˏ = (LinearLayout) findViewById(b.ʻ);
        this.ˋ = (UserInfoTextView) findViewById(b.ˏॱ);
        this.ˎ = (TextView) findViewById(b.ʽ);
        this.ᐝ = (TextView) findViewById(cbb.b.ͺ);
        this.ˋ.setFakeView(this.ᐝ);
        this.ˋ.setUserFakeViewChangeListener(this);
        ˎ(this.ॱ);
        ˎ(this.ᐝ);
        if (this.ˊॱ) {
            ˋ(inflate);
        }
    }

    public void setDomainId(String str) {
        this.ʼ = str;
    }

    private void ˋ() {
        if (this.ˊॱ) {
            this.ˏ.setMinimumHeight(getResources().getDimensionPixelSize(d.ʻ));
            return;
        }
        LayoutParams layoutParams = (LayoutParams) this.ˎ.getLayoutParams();
        layoutParams.topMargin = 0;
        this.ˎ.setLayoutParams(layoutParams);
        this.ˋ.setNickNameTextSize(getContext().getResources().getDimension(d.ˏ));
        RelativeLayout.LayoutParams layoutParams2 = (RelativeLayout.LayoutParams) this.ॱ.getLayoutParams();
        layoutParams2.width = epv.ˋ(this.ॱ.getContext(), this.ॱॱ);
        layoutParams2.height = epv.ˋ(this.ॱ.getContext(), this.ॱॱ);
        layoutParams2.setMarginStart(getResources().getDimensionPixelSize(d.ʼ));
        layoutParams2.setMarginEnd(getResources().getDimensionPixelSize(d.ʼ));
        this.ॱ.setLayoutParams(layoutParams2);
        this.ˋ.setContentWidth((((azb.ॱ(this.ˊ) - (this.ˊ.getResources().getDimensionPixelOffset(bsy.e.ʿ) * 3)) - this.ˊ.getResources().getDimensionPixelOffset(bsy.e.ˎˎ)) - (this.ˊ.getResources().getDimensionPixelOffset(bsy.e.ॱˎ) * 3)) - this.ˊ.getResources().getDimensionPixelOffset(bsy.e.ˉ));
    }

    public void setUser(User user) {
        this.ˋ.setVisibility(0);
        if (user != null) {
            equ.ˊ(this.ॱ, user.ˎ(), "head_default_icon");
            this.ˋ.setData(user);
            this.ˏॱ = user.ॱˎ();
            this.ʻ = user.ॱ();
            this.ʽ = user.ˊ();
            return;
        }
        bqx.ˏ("CommentReferenceUserView", "---------user is null-----------");
        equ.ˊ(this.ॱ, "", "head_default_icon");
        this.ˋ.setVisibility(4);
        this.ˏॱ = "";
        this.ʻ = null;
        this.ʽ = 0;
    }

    public void setSectionName(String str) {
        if (dof.ʽ(str)) {
            this.ˎ.setVisibility(4);
            return;
        }
        this.ˎ.setVisibility(0);
        this.ˎ.setText(str);
    }

    private void ˎ(View view) {
        if (view != null) {
            view.setOnClickListener(new 5(this));
        }
    }

    public void ˊ(int i) {
        int dimensionPixelSize;
        if (this.ˊॱ) {
            dimensionPixelSize = getResources().getDimensionPixelSize(bsy.e.ˎˎ) + (getResources().getDimensionPixelSize(d.ॱॱ) * 2);
        } else {
            dimensionPixelSize = getResources().getDimensionPixelSize(bsy.e.ˉ) + (getResources().getDimensionPixelSize(d.ᐝ) * 2);
        }
        this.ᐝ.setWidth(dimensionPixelSize + i);
    }

    private void ˋ(View view) {
        if (view != null) {
            view.setOnClickListener(new 1(this));
        }
    }

    public void setUserContentMaxWidth(int i) {
        if (this.ˋ != null) {
            this.ˋ.setContentWidth(i);
        }
    }
}
